package com.kfm.jdbc.day0330;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.charset.spi.CharsetProvider;
import java.util.Arrays;

public class Demo {

    public static void main(String[] args) {
        Charset utf8 = StandardCharsets.UTF_8;
        Charset charset = Charset.forName("gbk");

        try {
            FileReader reader = new FileReader("d:\\io\\reader.txt");

            int read = reader.read();
            System.out.println((char)read);

            reader.skip(2);

            char[] chars = new char[1024];
            int read1 = reader.read(chars, 0, 20);
            System.out.println(Arrays.toString(chars));

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
